<script setup lang="ts">
</script>

<template>
  <div class="container">
    <!-- 标题区域 -->
    <div class="title-section">
      <h1 class="main-title">加解密工具</h1>
      <p class="subtitle">选择功能开始操作</p>
    </div>

    <!-- 功能卡片容器 -->
    <div class="card-container">
      <!-- 加密卡片 -->
      <div id="encryptCard" class="function-card encrypt" @click="$router.push('/enryption')">
        <div class="card-icon-wrapper">
          <i-bx-bxs-lock-alt class="fa fa-lock card-icon" />
        </div>
        <h2 class="card-title">加密</h2>
        <p class="card-desc">对内容进行安全加密</p>
      </div>

      <!-- 解密卡片 -->
      <div id="decryptCard" class="function-card decrypt" @click="$router.push('/decryption')">
        <div class="card-icon-wrapper">
          <i-si-unlock-muted-fill class="fa fa-unlock card-icon" />
        </div>
        <h2 class="card-title">解密</h2>
        <p class="card-desc">对加密内容进行解密</p>
      </div>
    </div>

    <!-- 底部说明 -->
    <div class="footer">
      <p>© 2025 加解密工具</p>
    </div>
  </div>
</template>

<style>
/* 基础样式 */
:root {
  --encrypt-color: #3b82f6;
  --decrypt-color: #8b5cf6;
  --neutral-color: #f3f4f6;
  --white-color: #ffffff;
  --gray-800: #1f2937;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --shadow-light: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background: linear-gradient(135deg, var(--neutral-color), var(--white-color));
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
</style>
<style scoped>
/* 容器样式 */
.container {
  width: 100%;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: auto;
}

/* 标题样式 */
.title-section {
  text-align: center;
  margin-bottom: 40px;
}

.main-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--gray-500);
}

/* 卡片容器 */
.card-container {
  display: grid;
  gap: 24px;
  flex: 1;
}

@media (min-width: 768px) {
  .card-container {
    grid-template-columns: 1fr 1fr;
  }
}

/* 卡片样式 */
.function-card {
  background: var(--white-color);
  border-radius: 12px;
  padding: 32px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow-light);
  text-align: center;
  height: fit-content;
}

.function-card.encrypt {
  border-top: 4px solid var(--encrypt-color);
}

.function-card.decrypt {
  border-top: 4px solid var(--decrypt-color);
}

.function-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-heavy);
}

.card-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.encrypt .card-icon-wrapper {
  background-color: rgba(59, 130, 246, 0.1);
}

.decrypt .card-icon-wrapper {
  background-color: rgba(139, 92, 246, 0.1);
}

.card-icon {
  font-size: 2rem;
}

.encrypt .card-icon {
  color: var(--encrypt-color);
}

.decrypt .card-icon {
  color: var(--decrypt-color);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* 底部信息 */
.footer {
  text-align: center;
  margin-top: 32px;
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: auto;
}

/* 动画效果 */
.scale-up {
  animation: scaleUp 0.2s ease;
}

@keyframes scaleUp {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}
</style>
